<template>
    <div class="noData">

        <div class="bg">
            <img :src="bg" alt="">
        </div>
        <p>
            <span v-if="info.vip == 0" @click="tologin('/task/pay')">去订阅服务</span>
            <span  v-if="info.vip != 0&&model == 5" @click="tologin('/home/Search')">添加提醒</span>
            <span  v-if="info.vip != 0&&model == 1" @click="tologin('/home/sub?type=zn')">添加提醒</span>
            <span  v-if="info.vip != 0&&model == 2" @click="tologin('/home/sub?type=nx')">添加提醒</span>
            <span  v-if="info.vip != 0&&model == 6" @click="tologin('/home/contract')">添加提醒</span>
            <span  v-if="info.vip != 0&&model == 7" @click="tologin('/home/deviation')">添加提醒</span>
        </p>

    </div>
</template>

<script>
    import bg from '@/assets/img/img_dyfw.png'
    export default {
        name: "noData",
        data(){
            return {
                bg:bg,
                info:{},
                page:1
            }
        },
        props:['model','count'],
        watch:{
            "model":function () {
                this.getList()
            }
        },
        mounted() {
            this.$api.my.getInfo(this.getCookie('token')).then(res=> {
                // 执行某些操作
                this.info = res.data.data
            })
            this.getList()



        },
        methods:{
            getList(){
                let data = {
                    token:this.getCookie("token"),
                    page:this.page,
                    model:this.model
                }
                this.$api.home.GetMessage(data).then(res=> {
                    // 执行某些操作
                    if(res.data.data.length>0){
                        this.$router.push({path:'/message/list'})
                    }

                })
            }
        }
    }
</script>

<style scoped>
    .noData{
        position: relative;
        top: 3rem;

    }
    .noData p{
        text-align: center;

    }
    .bg{
        text-align: center;
        margin:1rem auto;
    }
    .noData .bg img{
        width: 9.06rem;
        display: inline-block;
    }
    p span{
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width:8.75rem;
        height:2rem;
        background:rgba(20,163,101,1);
        border-radius:0.2rem;
        font-size:0.94rem;
        font-family:PingFang SC;
        font-weight:500;
        color:rgba(255,255,255,1);
    }
</style>